﻿
@model KRM.Core.tblRDMQuestionnaire
@{
    ViewBag.Title = "PRE-RDM FAC CHECKLIST";
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
    var disputeid = ViewBag.disputeid;
}
<script>
    $(document).ready(function () {
        App.blockUI($('.checklistquestionnaire'), false);
        $.ajax({
            url: '/rdm/LoadNewQuestion?reasonid=' + $("#ReasonID").val() + "&questionnaireid=" + @(Model.ID),
            success: function (data) {
                $(".checklistquestionnaire").html(data);
            }
        });
        
        $("#ReasonID").change(function () {
            App.blockUI($('.checklistquestionnaire'), false);
            $.ajax({
                url: '/rdm/LoadNewQuestion?reasonid=' + $("#ReasonID").val(),
                success: function (data) {
                    $(".checklistquestionnaire").html(data);
                }
            });
        });
    });
</script>
<div style="padding: 10px 20px 0 20px; font-size: 12px">
    <input type="hidden" value="@Model.OrderItemID" id="OrderItemID" name="OrderItemID"/>
    <div class="row-fluid">
        <p>To add an RDM for a : @ViewBag.ProductOption please fill in the following check list and Pre-RDM Questionnaire:</p>
    </div>
    <div class="row-fluid">
        <div class="span1">Reason</div>
        <div class="span4">
            @Html.DropDownList("ReasonID", null, new { required = "required", @class = "input-block-level" })
        </div>
        <div class="span1"></div>
        <div class="span2">Reason detail</div>
        <div class="span4">
            @Html.DropDownList("ReasonDetailID", null, "--Please select--", new { required = "required", @class = "input-block-level" })
        </div>
    </div>
    Check List:
    <div class="border-padding10 checklistquestionnaire">
    </div>
    <p>Other comment - describe any damages and possible causes :</p>
    <div class="row-fluid">
        <textarea class="input-block-level" name="OtherComments">@Model.OtherComments</textarea>
    </div>
    <div class="row-fluid">
        <div class="span12 text-center" style="margin-top: 10px">
            @if (disputeid > 0)
            {
                <a class="btn btn-primary" href="/rdm/viewrdm/@disputeid" style="margin-left: 20px">Back</a>
            }
            else
            {
                <a class="btn btn-primary" href="/rdm/AddRdm?questionnaireid=@Model.ID" style="margin-left: 20px">Back</a>
            }

        </div>
    </div>
</div>
